_:
    @just --list

fmt: _yarn
    yarn run prettier --write --config .prettierrc.json src
    cd src-tauri && cargo fmt

fmt-check: _yarn
    yarn run prettier --check --config .prettierrc.json src
    cd src-tauri && cargo fmt -- --check

lint:
    cd src-tauri && cargo clippy -- -Dwarnings --no-deps

build: build-release

build-release: _yarn _bin
    cargo tauri build --no-bundle
    cp ../target/release/mcp-guardian ../_build/bin/
    chmod 755 ../_build/bin/mcp-guardian

test:
    cargo test

start: _yarn
    cargo tauri dev

clean:
    rm -rf node_modules dist
    cd src-tauri && cargo clean

_yarn:
    test -d node_modules || yarn

_bin:
    mkdir -p ../_build/bin
